package com.bwie.controller;

import com.bwie.pojo.TCj;
import com.bwie.pojo.TJp;
import com.bwie.service.TCjService;
import com.bwie.service.TJpService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import io.swagger.models.auth.In;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/index")
public class UserController {
    @Autowired
    TCjService tCjService;
    @Autowired
    TJpService tJpService;

    /**
     * 查找抽奖列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getCjList")
    public R getCjList(@RequestBody PageInfoVo pageInfoVo){
        return tCjService.getCjList(pageInfoVo);
    }
    /**
     *增加
     */

    @PostMapping("/zddcjList")
    public R zddcjList(@RequestBody TCj tCj){
        return tCjService.zddcjList(tCj);
    }

    /**
     * 修改
     * @param tCj
     * @return
     */
    @PostMapping("/updatecjList")
    public R updatecjList(@RequestBody TCj tCj){
        return tCjService.updatecjList(tCj);
    }

    /**
     * 删除
     * @param id
     * @return
     */

    @PostMapping("/deletecjList/{id}")
    public R deletecjList(@PathVariable("id")Integer id){
        return tCjService.deletecjList(id);
    }

    /**
     * 查找抽奖列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getjpList")
    public R getjpList(@RequestBody PageInfoVo pageInfoVo){
        return tJpService.getjpList(pageInfoVo);
    }
    /**
     *增加
     */

    @PostMapping("/addjpList")
    public R addjpList(@RequestBody TJp tJp){
        return tJpService.addjpList(tJp);
    }

    /**
     * 修改
     * @param
     * @return
     */
    @PostMapping("/updatejpList")
    public R updatejpList(@RequestBody TJp tJp){
        return tJpService.updatejpList(tJp);
    }

    /**
     * 删除
     * @param id
     * @return
     */

    @PostMapping("/deletejpList/{id}")
    public R deletejpList(@PathVariable("id")Integer id){
        return tJpService.deletejpList(id);
    }

}
